//引入layUI
let layer = layui.layer;
let form = layui.form;
$(function () {
  // 粒子线条背景
  $(document).ready(function () {
    $('.layui-container').particleground({
      dotColor: '#7ec7fd',
      lineColor: '#7ec7fd'
    })
  })
})
// 登录操作
$("form").on("submit", function (e) {
  e.preventDefault();
  let params = $(this).serialize();
  console.log(params);
  $.ajax({
    url: "api/login",
    type: "post",
    data: params,
    success: function (res) {
      if (res.status == 0) {
        location.href = "./index.html";
        localStorage.setItem("mytoken", res.token);
      }
    }
  })
})